package rita.grammar.simplesentence;

import java.util.ArrayList;
import java.util.List;

import renderable.RenderableBlock;
import rita.grammar.Command;
import rita.grammar.exception.IncompleteSentenceException;

/**
 * Esta clase representa a un bloque de datos simple
 *  
 * @author Vanessa Aybar Rosales
 * */
public class DataBlock extends Command{

	@Override
	public List<StringBuffer> render(RenderableBlock rBlock)
			throws IncompleteSentenceException {
		List<StringBuffer> returnedRenderList = new ArrayList<StringBuffer>();
		StringBuffer sb0 = null;
		if (rBlock.getBlock().getProperty("vm-value-type")!=null && rBlock.getBlock().getProperty("vm-value-type").equals("String"))
			sb0 = new StringBuffer("\""+rBlock.getBlock().getBlockLabel()+"\"");
		else
			sb0 = new StringBuffer(rBlock.getBlock().getBlockLabel());
		
		
		returnedRenderList.add(sb0);
		return returnedRenderList;
	}

}
